package com.zzyl.mapper;

import com.zzyl.entity.Bed;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BedMapper {

    List<BedVo> getBedsByRoomId(Long roomId);

    void insert(Bed bed);

    @Select("SELECT * FROM bed WHERE id = #{id}")
    Bed selectById(@Param("id") Long id);

    /**
     * 更新床位
     * @param bed
     */
    void updateBed(Bed bed);

    /**
     * 删除
     * @param id
     */
    @Delete("delete from bed where id = #{id}")
    void deleteBedById(Long id);
}

